home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / readme < prev    next >
Text File  |  1996-01-30  |  24KB  |  527 lines

  1.  
  2. 1. INTRODUCTION.
  3.  
  4. This file is the README file from the distribution of Ada/Ed version
  5. 1.11.1-PC, an Ada interpreter for 386/486 machines running MS-DOS/PC-DOS.
  6. The distribution consists of a single compressed tar file 
  7. and is available through anonymous ftp on cs.nyu.edu (128.122.140.24)
  8. in the directory pub/adaed.  The distribution contains sources and
  9. executables.  The ftp directory contains another distribution for
  10. Unix-based machines.
  11.  
  12. This program is free software; you can redistribute it and/or modify
  13. it under the terms of the GNU General Purpose License as published by
  14. the Free Software Foundation; either version 2 of the License, or
  15. (at your option) any later version. See relevant excerpts below.
  16.  
  17. Ada/Ed is a translator-interpreter for Ada. It is intended as a teaching
  18. tool, and does not have the capacity, performance,  or robustness of 
  19. commercial Ada compilers. Ada/Ed was developed at New York University, as
  20. part of a long-range project in language definition and software prototyping. 
  21. The project produced the first validated translator for Ada, in the form of
  22. an executable definition of the language written in SETL. The SETL system
  23. served as design document and prototype for the C version being released today.
  24.  
  25. Ada/Ed was last validated under version 1.7 of the ACVC tests. Therefore it is
  26. not currently a validated Ada system, and users can expect to find  small
  27. discrepancies between Ada/Ed and currently validated compilers. 
  28.  
  29. Apart from the 100-odd tests of ACVC 1.11 that Ada/Ed currently fails, the
  30. major deficiency of the system is that, being an interpreter, it does not 
  31. implement most representation clauses, and thus does not support systems 
  32. programming close to the machine level. 
  33.  
  34. We trust that even with these limitations, Ada/Ed will be of use to the
  35. Ada community at large: students, educators, user, and implementors. The 
  36. sources of the system should be of interest to compiler writers, and we hope 
  37. that they will encourage the construction of software tools to make the system
  38. more usable and polished. The NYUADA project does not have the resources to
  39. promise regular new maintenance releases of the software, but will do its
  40. best to keep track of reported errors, workarounds, and fixes. We will also
  41. produce at irregular intervals design notes and additional documentation on
  42. the front-end of the system.  We  urge users to send comments, corrections 
  43. and bug reports (reduced to their simplest form!)  to:   adaed@cs.nyu.edu
  44.  
  45.  
  46. All users of Ada/Ed are urged to register themselves by
  47. sending email to the above address, or to the NYUADA project, New
  48. York University, 251 Mercer Street, New York, NY 10012. This will allow us to
  49. notify users of updates and new releases of the system.
  50.  
  51.  
  52. 2. (UN) WARRANTY
  53.  
  54. This software is release 1.11.1-PC of the Ada/Ed system.
  55. It is distributed absolutely WITHOUT ANY WARRANTY; without even the implied 
  56. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  57. General Public License for more details.
  58.  
  59. To receive a copy of the GNU General Public License write to the Free
  60. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139.
  61.  
  62. The following is an excerpt from the GNU General Public License concerning
  63. warranties:
  64.  
  65. Because the program is licensed free of charge, there is no warranty
  66. for the program, to the extent permitted by applicable law.  Except when
  67. otherwise stated in writing the copyright holders and/or other parties
  68. provide the program "as is" without warranty of any kind, either expressed
  69. or implied, including, but not limited to, the implied warranties of
  70. merchantability and fitness for a particular purpose.  The entire risk as
  71. to the quality and performance of the program is with you.  Should the
  72. program prove defective, you assume the cost of all necessary servicing,
  73. repair or correction.
  74.  
  75. In no event unless required by applicable law or agreed to in writing
  76. will any copyright holder, or any other party who may modify and/or
  77. redistribute the program as permitted above, be liable to you for damages,
  78. including any general, special, incidental or consequential damages arising
  79. out of the use or inability to use the program (including but not limited
  80. to loss of data or data being rendered inaccurate or losses sustained by
  81. you or third parties or a failure of the program to operate with any other
  82. programs), even if such holder or other party has been advised of the
  83. possibility of such damages.
  84.  
  85. 3. INSTALLATION
  86.  
  87. To intall Ada/Ed choose a directory to contain the executables and
  88. library files; include this directory on the PATH; set the environment
  89. variable ADAED to the pathname for this directory; and copy the files
  90. *.exe, predef.axq, predef.trc, and predef.lib into the directory.
  91.  
  92. For example, if the directory chosen is C:\ADAED, then the AUTOEXEC.BAT
  93. might contain lines such as:
  94.  
  95. PATH=C:;C:\ADAED
  96. SET ADAED=C:\ADAED
  97.  
  98. Try some of the supplied demo program (see the readme in the demos directory)
  99. Also look at the release.notes for more information about the system and
  100. the changes that have take place.
  101.  
  102. 4. REBUILDING
  103.  
  104. Ada/Ed is written in C, and built using Intel's 386/486 C Code Builder.  
  105. The sources and makefile for doing this are part of the distribution.  To
  106. rebuild, read the makefile and execute "make" and "make predef.lib" or
  107. just "make predef.lib".  In particular, note the comment in the makefile
  108. about the include file makeext.  After rebuilding, follow the installation
  109. instructions above.
  110.  
  111.  
  112. 5. USING Ada/Ed
  113.  
  114. The Ada/Ed system includes the following commands:
  115.  
  116.  adacomp     [ -abgsv ] [ -m  main_unit ] [ -n ] [-l library ]  file
  117.  
  118.  adabind     [ -m  main_unit ]  [-l library]
  119.  
  120.  adaexec     [ -h heap] [ -m   bound_main_unit ] [-p pstack] [-s  tstack]
  121.              [ -r nb_stmts] [ -t [acerst] ]   [-l library]
  122.  
  123.  adalib      [-l library]
  124.  
  125. Description
  126.  
  127. Ada/Ed is a translator/interpreter for the Ada programming language that
  128. is intended primarily for educational use.
  129.  
  130. Adacomp compiles an Ada program; it invokes in succession the two
  131. compilation phases: parsing and semantic analysis (the front end) ,and 
  132. code generation.  The file argument refers to the source file; if no 
  133. extension is given for it, the extension ADA is assumed. The file argument 
  134. may contain drive and directory specifications.  The output of the compiler 
  135. is an instruction stream for an abstract Ada machine, which is then 
  136. interpreted.
  137.  
  138. Adabind binds a given library with the specified main unit to form an
  139. executable program.
  140.  
  141. Adaexec invokes the Ada machine interpreter for the bound program given in 
  142. the specified library. 
  143.  
  144. Adalib displays the contents of the specified library.
  145.  
  146. Note :  All options must precede the file name and may be in either lower or
  147.         upper case.
  148.  
  149. Program Library
  150.  
  151. All compilations require a library. A library is a directory, which is
  152. created or reinitialized when the user invokes a command containing a -n
  153. option such as:
  154.  
  155.     adacomp   -n  -l  libname   adafile
  156.  
  157. Intermediate files appear in directory libname. This directory is created by
  158. the command if it does not already exist. Only the listing files are created
  159. in the directory from which adacomp is invoked. The libname directory should
  160. only be used to hold files created by the adacomp command (i.e. those
  161. produced by the Ada/Ed system); confusion and grief may result if you attempt
  162. to use a library directory to hold other files. The libname argument may
  163. contain drive and path specifications.
  164.  
  165. The libname argument can be omitted if the environment variable ADALIB is
  166. defined. For example, if you are doing several compilations referring to
  167. the same library you can use the command
  168.         SET  ADALIB=C:\MYLIB
  169. to indicate the library to be used. In this way the -l option (including
  170. its library name argument) to adacomp, adabind, adaexec and adalib can be 
  171. omitted.
  172.  
  173. A given utility library UL (e.g. one that contains mathematical functions)
  174. may be used by several unrelated programs. It may then be convenient to
  175. create independent libraries for each program, and initialize each library
  176. with the contents of UL. This can be done simply by creating directories
  177. for each library, and copying the contents of UL into each of these, using
  178. DOS commands.
  179.  
  180.  
  181. Options
  182.  
  183. The options for adacomp are as follows:
  184.  
  185.  -a    Generates instructions for use by the interpreter (adaexec) to
  186.        trace the ada source lines, and is used in conjunction with the
  187.        -t a option of adaexec.  This is also necessary to get at run-time
  188.        the source line number at which an exception is raised.
  189.  
  190.  -b    Indicates that the binding of the library is to be performed if
  191.        the current compilation is completed without errors.
  192.  
  193.  -g    Specifies that the compiler is to produce a listing of the
  194.        generated instructions for the Ada machine (of little interest
  195.        to most users).
  196.  
  197.  -l library
  198.        Uses the specified library to satisfy references to compilation
  199.        units not present in the file being compiled. If the compilation
  200.        is successful, the units defined in the file are added to the
  201.        library. If  the -l option is not used, the environment symbol
  202.        ADALIB specifies the library.
  203.  
  204.  -m unit_name
  205.        Specifies the name of the unit which is to serve as a main unit.
  206.        When the library contains only one main program - which must be a
  207.        parameterless procedure - this option is not needed. This is an
  208.        option to the binder and is only relevant if the -b option is used.
  209.  
  210.  -n    Indicates that a new library is to be created for this compilation.
  211.        The name of the library is indicated by the -l option or by use of
  212.        the ADALIB environment symbol. The -n option must be specified if
  213.        the library referenced by the -l  option does not already exist or
  214.        if the user wants to reinitialize it.
  215.  
  216.  -s    Obtain a listing of the source file. The filename of the listing
  217.        file is the input file name with a filename extension of LST, and
  218.        is written in the directory from which the adacomp command is
  219.        invoked. By default a listing is not generated unless there are
  220.        warnings, errors or informational messages to report.
  221.  
  222.  -v    Give a descriptive trace showing the subsidiary programs invoked
  223.        by the adacomp command, the arguments passed to them, and their
  224.        exit status. This is used primarily for system checkout.
  225.  
  226.  
  227. The options for adabind are as follows:
  228.  
  229.  -l library
  230.        Specifies the library which together with the main unit will produce 
  231.        a bound program which can be executed by adaexec.  If  this option is
  232.        not specified explicitly, a default library is implicitly defined by
  233.        the environment symbol ADALIB.
  234.  
  235.  -m unit_name
  236.        Specifies the name of the unit which is to serve as a main unit.
  237.        When the library contains only one main program - which must be a
  238.        parameterless procedure - this option is not needed.
  239.  
  240.  
  241. The options for adaexec are as follows:
  242.  
  243.  -l library
  244.        Specifies the library which contains the bound program to be executed.
  245.        If this option is not specified explicitly, a default library is 
  246.        implicitly defined by the environment symbol ADALIB.
  247.  
  248.  -m unit_name
  249.       Specifies the name of the bound main unit, i.e. the main unit that
  250.       was specified to adabind or adacomp. Note that a given library may
  251.       have been bound several times with different main units. When the
  252.       library has been bound with only one main unit this option is not
  253.       needed.
  254.  
  255.  -h heap
  256.       Specifies the size of the heap increment in kilowords, by which the
  257.       heap is expanded when the elaboration of a new entity requires it.
  258.       The heap expands to fill available memory. The default increment is
  259.       32. This parameter limits the size of the largest object that can be
  260.       created in a program.
  261.  
  262.  -p pstack
  263.       Specifies the size in bytes of the program stack size for the main
  264.       task. The default is 4096. Argument values in the range 1..31 are
  265.       multiplied by 1024 to obtain the stack size in bytes. The maximum
  266.       value is 32767.
  267.  
  268.  -s tstack
  269.       Specifies the size in bytes of the stack size for each new task.
  270.       The default is 2048. Argument values in the range 1..31 are multiplied
  271.       by 1024 to obtain the stack size in bytes. Use of small stack sizes
  272.       may be appropriate when executing programs with many tasks, each of
  273.       which can run with a small stack.  The maximum value is 32767.
  274.  
  275.  -r number_of_statements (an integer)
  276.       Invoke a 'round-robin' scheduling policy instead of the 'run-until-
  277.       -block' default scheduling policy and specify the maximum number of
  278.       interpreted statements that a given task can execute before switching 
  279.       to another task. (the minimum value is 1).
  280.  
  281.  -t [acerst]
  282.       Specify the kind of trace requested for the execution of the program:
  283.       a    Display the source line numbers.  This requires that the program
  284.            be compiled with the -a option.
  285.       c    Display the name of each routine as it is entered and exited.
  286.       e    Display the name of each exception as it is raised.
  287.       r    Trace each rendezvous.
  288.       s    Display the context-switches between tasks.
  289.       t    Display task creation, activation, and termination.
  290.  
  291. Examples
  292.  
  293. The following examples show typical usage:
  294.  
  295. 1.   Compile T1.ADA into a new library called TSTLIB and bind the library,
  296.      and then execute it. The listing is written to T1.LST. The -s option
  297.      is used to force a listing file to be created.
  298.  
  299.         adacomp  -s  -n  -l  tstlib  -b   t1
  300.         adaexec  -l tstlib
  301.  
  302. 2.   Compile a package specification in P.SPC and the corresponding body
  303.      in P.BOD, into a new library called TSTLIB. Then compile T2.ADA into
  304.      the same library, bind the main program, and then execute it.
  305.  
  306.         adacomp  -n  -l  tstlib  p.spc
  307.         adacomp  -l  tstlib  p.bod
  308.         adacomp  -l  tstlib  -b  t2
  309.         adaexec  -l tstlib
  310.  
  311. 3.   In the example above, the binding could be done in a separate phase.
  312.      This is achieved by replacing the third command above with:
  313.  
  314.         adacomp -l  tstlib t2
  315.         adabind -l tstlib
  316.  
  317. 4.   Example 2 above could be done without explicitly specifying the
  318.      library by defining the environment symbol adalib as follows:
  319.  
  320.         set  adalib=c:\mylib
  321.         adacomp  -n  p.spc
  322.         adacomp  p.bod
  323.         adacomp  -b t2
  324.         adaexec
  325.  
  326. 5.   Compile a program with line numbers included in the generated code.
  327.      Execute it displaying source line numbers as they are encountered.
  328.  
  329.         adacomp  -a  -l  -b  tstlib   t1
  330.         adaexec  -t  a  -l tstlib
  331.  
  332. 6.   Compile a program with two parameterless procedures (potential main
  333.      programs) which are named MAIN1 and MAIN2 and bind the library TSTLIB
  334.      using MAIN1 as the main program.
  335.  
  336.         adacomp  -n  -l  tstlib p1
  337.         adacomp  -l  tstlib p2
  338.         adabind  -m  main1 -l tstlib
  339.         adaexec  -l tstlib
  340.  
  341. 7.   Suppose we wish to add another program to the library TSTLIB (created
  342.      in Example 6) whose main program unit is named MAIN3 and appears in
  343.      file P3.ADA.  The following commands will compile and execute MAIN3.
  344.      As TSTLIB was previously bound with MAIN1 as a main unit, it is now
  345.      necessary to use the -m option on the adaexec command in order to
  346.      select the desired bound main unit.
  347.  
  348.         adacomp  -l  tstlib  p3
  349.         adabind  -m  main3  -l tstlib
  350.         adaexec  -m  main3  -l tstlib
  351.  
  352. 8.   The contents of a library can be examined with:
  353.         adalib  -l tstlib
  354.      Adalib writes to the standard output the name, type and compilation
  355.      date of each compilation unit. In addition, it writes the current
  356.      status (active or obsolete) of each unit.  Units which may be main
  357.      programs are noted by "(Main)"; if there is more than one such unit,
  358.      the -m option of adabind must be specified during binding. Libraries
  359.      that have been bound will contain at least one unit labelled "binding
  360.      unit". If several of those are active, the -m option must be specified
  361.      for adaexec.
  362.  
  363. 9.   The DOS redirection facilities can be used with the adaexec and
  364.      adalib commands. In particular, use with the adaexec command permits
  365.      a program to associate the default input and output files with
  366.      specified files; for example,
  367.         adaexec  -l tstlib  <i.dat  >o.dat
  368.      causes execution of the bound program in library TSTLIB with standard
  369.      input taken from I.DAT and standard output written to O.DAT.  The
  370.      output from adalib may also re redirected.
  371.  
  372.  
  373.  
  374. Diagnostics, Exit Codes and Termination
  375.  
  376. Adaed commands return an exit code of 0 in the case of success, and
  377. nonzero otherwise. An error code of 1 indicates errors in usage of the
  378. Ada language, 2 is returned if there is an internal system error, and
  379. 3 denotes some invalid usage of the system. Error messages regarding
  380. invalid system usage are directed to the standard error file. Ada-language
  381. related messages detected by adacomp are written to the listing file,
  382. while those detected by adabind or adaexec appear on standard output.
  383.  
  384. Note that an error in a given compilation unit may cause subsequent
  385. compilation units (within the same compilation) not to be recognized.
  386.  
  387. Any compilation or execution that terminates abnormally with the error
  388. message "capacity limit exceeded" indicates a program that is too large
  389. for the compiler. Any compilation or execution that terminates abnormally
  390. with mention of "internal error" has uncovered a bug that should be
  391. reported to the NYU Ada group (adaed@cs.nyu.edu).
  392.  
  393. 6. APPENDIX F
  394.  
  395.     (1)  The form, allowed places, and effect of implementation dependent
  396.          pragmas.
  397.  
  398.        NYU Ada/Ed does not recognize any implementation dependent pragmas.
  399.        The language  defined  pragmas  are  correctly recognized and their
  400.        legality is checked, but, with the exception of LIST, PRIORITY, and
  401.        INTERFACE they  have  no  effect  on  the execution of the program. 
  402.        A warning message  is  generated  to  indicate  that  the  pragma  
  403.        is ignored by Ada/Ed.
  404.  
  405.     (2)  The name and the type of every implementation dependent attribute.
  406.  
  407.        There are no implementation dependent attributes in NYU Ada/Ed.
  408.  
  409.     (3)  The specification of the package system (see 13.7).
  410.  
  411.  
  412.              package SYSTEM is
  413.  
  414.                 type SEGMENT_TYPE is new INTEGER range 0..255;
  415.                 type OFFSET_TYPE  is new INTEGER range 0..32767;
  416.                 type ADDRESS is record
  417.                    SEGMENT: SEGMENT_TYPE := SEGMENT_TYPE'LAST;
  418.                    OFFSET: OFFSET_TYPE := OFFSET_TYPE'LAST;
  419.                 end record;
  420.  
  421.                 type NAME    is (ELXSI_BSD, ELXSI_ENIX, PC_DOS, 
  422.                                    SUN_UNIX, VAX_UNIX, VAX_VMS) ; 
  423.  
  424.                 SYSTEM_NAME  : constant NAME := PC_DOS;
  425.  
  426.                 STORAGE_UNIT    : constant  :=  8;
  427.                 MEMORY_SIZE     : constant  :=  2**16 - 1;
  428.  
  429.                 -- System Dependent Named Numbers:
  430.  
  431.                 MIN_INT         : constant  :=  -2**31;
  432.                 MAX_INT         : constant  :=  2**31 - 1;
  433.                 MAX_DIGITS      : constant  :=  6;
  434.                 MAX_MANTISSA    : constant  :=  31;
  435.                 FINE_DELTA      : constant  :=  2.0 ** (-30);
  436.                 TICK            : constant  :=  0.01;
  437.  
  438.                 -- Other System Dependent Declarations
  439.  
  440.                 subtype PRIORITY is INTEGER range 0 .. 4;
  441.  
  442.                 SYSTEM_ERROR  :  exception;
  443.                                 -- raised if internal check fails
  444.  
  445.              end SYSTEM;
  446.  
  447.  
  448.     (4)  The list of all restrictions on representation clauses (see 13.1).
  449.  
  450.        NYU Ada/Ed supports the representation clauses for SMALL for
  451.        fixed points specifying powers of 2 and 10.  NYU Ada/Ed  supports 
  452.        no other representation  clauses,  and  a  program containing any
  453.        instance of any representation clause is  considered to be illegal.
  454.  
  455.     (5)  The  conventions  used  for  any   implementation-generated  name
  456.          denoting  implementation-dependent  components (see 13.4).
  457.  
  458.        NYU Ada/Ed  does  not  provide  any system generated names denoting
  459.        system   dependent  entities,  since  in  any case,  representation
  460.        specifications  are not permitted.
  461.  
  462.     (6)  The interpretation of expressions that appear in address clauses.
  463.  
  464.        Addresses  in  NYU  Ada/Ed  are  fully  supported. The ADDRESS type
  465.        defined in the package SYSTEM is a record consisting of two fields.
  466.        The  first  is  an unsigned byte which contains the segment number.
  467.        The  second  is  the  offset  within  the  segment,  ranging from 0
  468.        to 32767.
  469.  
  470.     (7)  Any restriction on unchecked conversions (see 13.10.2).
  471.  
  472.        NYU Ada/Ed will correctly recognize and check the validity  of  any
  473.        use  of unchecked  conversion.  However, any program which executes
  474.        an  unchecked  conversion  is  considered to be erroneous, and  the
  475.        exception  PROGRAM_ERROR  will be raised.
  476.  
  477.     (8)  Any implementation-dependent characteristics of the  input-output
  478.          packages (see 14).
  479.  
  480.        A) Temporary files are fully supported. The names are generated 
  481.           using the "tmpnam" C library function and therefore will not 
  482.           interfere with any existing file.
  483.  
  484.        B) Deletion of files is fully supported.
  485.  
  486.        C) Only one internal file may be associated  with the same external
  487.           file (No multiple accessing of files allowed).
  488.  
  489.        D) File names used in the CREATE and OPEN procedures  are  standard
  490.           Unix file names.  The  function FORM returns the string given as
  491.           FORM  parameter  when  a  file  is  created. No system-dependent
  492.           characteristics  are  associated  with that parameter.
  493.  
  494.        E) A  maximum  of  20  files  can  be open at any given time during
  495.           program execution.
  496.  
  497.        F) The  standard  input file is  stdin; the  standard  output  file
  498.           is stdout.
  499.  
  500.        G) SEQUENTIAL_IO  and  DIRECT_IO  support  constrained array types,
  501.           record  types  without  discriminants  and  record  types  with
  502.           discriminants with defaults. SEQUENTIAL_IO and DIRECT_IO are not
  503.           supported for unconstrained types.
  504.  
  505.        H) I/O on  access types is possible, but  usage  of  access  values
  506.           read  in  another program execution is erroneous.
  507.  
  508.        I) Normal termination of the main  program  causes  all  open files
  509.           to  be closed, and all temporary files to be deleted.
  510.  
  511.        J) LOW_LEVEL_IO is not supported.
  512.  
  513.        K) The  form  feed  character  (ASCII.FF)  is  used  as  the  page
  514.           terminator  indicator.  Its  use as a data element of a file is
  515.           therefore undefined.
  516.  
  517.     (9)  The Implementation Limitations.
  518.  
  519.        The maximum identifier length (number of characters):   120
  520.        The maximum number of characters in a source line:      120
  521.        The maximum number of lines in a source file:         32767
  522.  
  523.        Generic  declarations  and  their corresponding bodies must appear
  524.        in the same compilation. Subunits of a generic must be part of the
  525.        same compilation (see 10.3(9)).
  526.  
  527.